﻿namespace DistrRTgen
{
    using System;

    internal class IndexHash
    {
        private uint _ChainLength;
        private string _Charset;
        private DateTime _ExpireTime;
        private string _Hash;
        private string _HashRoutine;
        private uint _Index;
        private ulong[] _IndexList;
        private bool _InUse;
        private uint _MaxLetters;
        private uint _MinLetters;
        private uint _RequestID;
        private string _Salt;

        public IndexHash(uint RequestID, string Hash, string HashRoutine, string Charset, uint ChainLength, uint MinLetters, uint MaxLetters, uint Index, string Salt, DateTime ExpireTime)
        {
            this._RequestID = RequestID;
            this._Hash = Hash;
            this._HashRoutine = HashRoutine;
            this._Charset = Charset;
            this._ChainLength = ChainLength;
            this._MinLetters = MinLetters;
            this._MaxLetters = MaxLetters;
            this._Index = Index;
            this._Salt = Salt;
            this._ExpireTime = ExpireTime;
        }

        public uint ChainLength
        {
            get
            {
                return this._ChainLength;
            }
            set
            {
                this._ChainLength = value;
            }
        }

        public string Charset
        {
            get
            {
                return this._Charset;
            }
            set
            {
                this._Charset = value;
            }
        }

        public DateTime ExpireTime
        {
            get
            {
                return this._ExpireTime;
            }
        }

        public string Hash
        {
            get
            {
                return this._Hash;
            }
            set
            {
                this._Hash = value;
            }
        }

        public string HashRoutine
        {
            get
            {
                return this._HashRoutine;
            }
            set
            {
                this._HashRoutine = value;
            }
        }

        public uint Index
        {
            get
            {
                return this._Index;
            }
            set
            {
                this._Index = value;
            }
        }

        public string IndexList
        {
            get
            {
                if (this._IndexList == null)
                {
                    return "";
                }
                string sIndices = "";
                for (int i = 0; i < this._IndexList.Length; i++)
                {
                    if (i != 0)
                    {
                        sIndices = sIndices + ",";
                    }
                    sIndices = sIndices + this._IndexList[i].ToString();
                }
                return sIndices;
            }
        }

        public ulong[] IndexListUint64
        {
            set
            {
                this._IndexList = value;
            }
        }

        public bool InUse
        {
            get
            {
                return this._InUse;
            }
        }

        public uint MaxLetters
        {
            get
            {
                return this._MaxLetters;
            }
            set
            {
                this._MaxLetters = value;
            }
        }

        public uint MinLetters
        {
            get
            {
                return this._MinLetters;
            }
            set
            {
                this._MinLetters = value;
            }
        }

        public uint RequestID
        {
            get
            {
                return this._RequestID;
            }
            set
            {
                this._RequestID = value;
            }
        }

        public string Salt
        {
            get
            {
                return this._Salt;
            }
            set
            {
                this._Salt = value;
            }
        }
    }
}

